import { defineStore } from 'pinia'
import { ref } from 'vue'
import { 
  ConfigProviderTheme, 
  ConfigProviderThemeVars 
} from 'wot-design-uni/components/wd-config-provider/types';

interface ThemeState {
  theme: ConfigProviderTheme;
  title: string;
  isChat: boolean;
}

// light / dark
const initState: ThemeState = {
  theme: 'light',
  title: '首页',
  isChat: false,
}

export const useThemeStore = defineStore('theme', () => {
  const themeConfig = ref({ ...initState })

  const themeVars: {
    [key: string]: ConfigProviderThemeVars
  } = {
    light: {
      colorTheme: '#9C6DEF',
    },
    dark: {
      colorTheme: '#9C6DEF',
      inputBg: '#141414',
      // buttonPrimaryBgColor: '#9C6DEF',
      // buttonPrimaryColor: '#07c160',
    }
  }
  
  return {
    themeConfig,
    themeVars
  }
}, { persist: true })
